package org.zsl.service;


import org.springframework.stereotype.Service;
import org.zsl.dao.mybatis.UserMapper;
import org.zsl.model.ResponseMsg;
import org.zsl.model.User;

import java.util.List;

@Service
public class UserService3 {

     private UserMapper userMapper;

     public List<User> getList(){

          return  userMapper.selectAll();

     }

     public ResponseMsg register(User user){

          ResponseMsg responseMsg = new ResponseMsg();
          Boolean flag = false;
          // 前置工作

          flag=  userMapper.insert(user)>0;
          responseMsg.setSuccess(flag);

        //  responseMsg.setSuccess(userMapper.insert(user)>0);

          return  responseMsg;

     }
}
